﻿var _page = (function () {
    return {
        Init: function (startPage, controller) {
            Main.State.Hashes.push(startPage);
            Main.State.CurrentPage(startPage);
            Main.State.CurrentController(controller);

            Sammy().run();
        },
        ChangeHash: function (hash) {
            window.location.hash = '#' + hash;
        },
        ChangePage: function (page) {
            $.when(ui.Animation.MainExit()).done(function () {
                document.location = page;
            });
        },
        ChangePageAndHash: function (page, hash) {
            document.location = page + "#" + hash;
        }
    };
})();